/*
 * PayMethod.java
 * 
 * Created: Feb 20, 2015
 * 
 * Copyright (c) ExpertPB 2014
 * All information contained herein is, and remains the property of
 * ExpertPB and its suppliers, if any.
 */
package com.emex.app.shared.data.enums;

import java.util.HashMap;
import java.util.Map;

/**
 *
 * @author Sergey Karavaev
 */
public enum PayMethod {

    CASH(0),
    CARD(1),
    QIWI(2),
    KARTA(3);

    private int statusNo;

    private static Map<Integer, PayMethod> map
            = new HashMap<Integer, PayMethod>();

    static {
        for (PayMethod ord : PayMethod.values()) {
            map.put(ord.statusNo, ord);
        }
    }

    private PayMethod(final int no) {
        statusNo = no;
    }

    public static PayMethod valueOf(int no) {
        return map.get(no);
    }

    @Override
    public String toString() {
        switch (this) {
            case CASH:
                return "Наличные";
            case CARD:
                return "Без.нал.";
            case QIWI:
                return "QIWI кошелек";
            case KARTA:
                return "Карта";
            default:
                return "";
        }
    }

}
